using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class web_Controls_page_center_ntv : System.Web.UI.UserControl
{
    Common _common = null;
    protected void Page_Load(object sender, EventArgs e)
    {
        _common = new Common();
        LoadUngvienNew();
        LoadUngvienNoibat();
    }
    void LoadUngvienNew()
    {
        string _sql = "select top 6 A.ma_nguoi, A.ho_ten, convert(varchar, A.ngay_sinh, 103) ngaysinh_vn, C.ten_chuyen_mon from ConNguoi_nguoi as A left join (select top 1 * from ConNguoi_hoc_van_chuyen_mon where kich_hoat = 1) as B on A.ma_nguoi = B.ma_nguoi ";
        _sql += " left join danhmuc_chuyen_mon as C on B.ma_chuyen_mon = C.ma_chuyen_mon  ";
        _sql += " left join NguoiTimViec_ho_so as D on A.ma_nguoi = D.ma_nguoi where D.kich_hoat = 1 and A.kich_hoat = 1 order by D.ngay_dang_ky desc";

        rpt_ungvien_new.DataSource = _common.ExeceuteDataset(_sql);
        rpt_ungvien_new.DataBind();
    }
    void LoadUngvienNoibat()
    {
        string _sql = "select top 6 A.ma_nguoi, A.ho_ten, convert(varchar, A.ngay_sinh, 103) ngaysinh_vn, C.ten_chuyen_mon from ConNguoi_nguoi as A left join ConNguoi_hoc_van_chuyen_mon as B on A.ma_nguoi = B.ma_nguoi ";
        _sql += " left join danhmuc_chuyen_mon as C on B.ma_chuyen_mon = C.ma_chuyen_mon  ";
        _sql += " left join NguoiTimViec_ho_so as D on A.ma_nguoi = D.ma_nguoi where D.kich_hoat = 1 and A.kich_hoat = 1 and D.noi_bat = 1 order by D.ngay_dang_ky desc";

        rpt_ungvien_noibat.DataSource = _common.ExeceuteDataset(_sql);
        rpt_ungvien_noibat.DataBind();
    }
}
